草庐IT

firebase - flutter NoSuchMethodError

全部标签

Flutter 来自 firebase 存储 url 的图像未在二等舱中显示

我已经从firebase存储中获取图像。文档快照在类里面传递,其中正在构建流意味着第一个类,图像显示在第二堂课,但我必须在下一个类即第三堂课的Hero小部件中显示图像。因此,在第三类中,错误是:到目前为止我的代码是:从二等舱到三等舱Container(padding:EdgeInsets.all(10.0),child:Hero(tag:'1',child:GestureDetector(onTap:(){//navigateToImage(widget.ds.data['GraphImg']);Navigator.push(context,MaterialPageRoute(buil

Flutter 来自 firebase 存储 url 的图像未在二等舱中显示

我已经从firebase存储中获取图像。文档快照在类里面传递,其中正在构建流意味着第一个类,图像显示在第二堂课,但我必须在下一个类即第三堂课的Hero小部件中显示图像。因此,在第三类中,错误是:到目前为止我的代码是:从二等舱到三等舱Container(padding:EdgeInsets.all(10.0),child:Hero(tag:'1',child:GestureDetector(onTap:(){//navigateToImage(widget.ds.data['GraphImg']);Navigator.push(context,MaterialPageRoute(buil

firebase - 存储和转换 MaterialColors

如果我有一个MaterialColor(例如Colors.red)并想将它保存在Firestore(或任何数据库)中,然后当我重新启动应用程序时,检索该颜色并将其转换为MaterialColor,最好的方法是什么去做?我最初想到的只是将颜色作为字符串存储在数据库中,例如“蓝色”、“红色”等,然后使用switch语句再次将它们转换为MaterialColors。似乎有更好的出路。有什么建议吗? 最佳答案 将颜色存储为1,2,3,4…(越小越好,以便快速检索)。然后在一个全局类中,有一个基于整数返回颜色的get函数。

firebase - 存储和转换 MaterialColors

如果我有一个MaterialColor(例如Colors.red)并想将它保存在Firestore(或任何数据库)中,然后当我重新启动应用程序时,检索该颜色并将其转换为MaterialColor,最好的方法是什么去做?我最初想到的只是将颜色作为字符串存储在数据库中,例如“蓝色”、“红色”等,然后使用switch语句再次将它们转换为MaterialColors。似乎有更好的出路。有什么建议吗? 最佳答案 将颜色存储为1,2,3,4…(越小越好,以便快速检索)。然后在一个全局类中,有一个基于整数返回颜色的get函数。

firebase - List<dynamic> 不是 List<Option> 的子类型

我有一个带有questions的CloudFirebase数据库收藏。每个question有map列表options.我正在使用Flutter并为question设置了以下类和option:classQuestion{finalStringtext;finalListoptions;//IhavetriedchangingthistoListbutitdoesn'thelpfinalStringreference;Question(this.text,this.options,this.reference);Question.fromMap(Mapmap,{this.reference

firebase - List<dynamic> 不是 List<Option> 的子类型

我有一个带有questions的CloudFirebase数据库收藏。每个question有map列表options.我正在使用Flutter并为question设置了以下类和option:classQuestion{finalStringtext;finalListoptions;//IhavetriedchangingthistoListbutitdoesn'thelpfinalStringreference;Question(this.text,this.options,this.reference);Question.fromMap(Mapmap,{this.reference

firebase - 如何使用事务监控整个子集合?

关注这个answer我尝试使用事务来监视整个Firestore子集合以添加新文档。基本上,如果只有一个文档,我只想将新文档写入子集合。我需要使用事务来避免竞争条件导致子集合中有>2个文档。最大值应为2。如何使用事务来监控添加到子集合的文档?我尝试了很长时间,但无法解决。我正在尝试使用遍历文档的子集合,但不知道如何通过事务执行此操作。到目前为止我的代码(可能是错误的方法):Firestore.instance.runTransaction((transaction)async{finalCollectionReferencecollectionRef=ref.document(‘docu

firebase - 如何使用事务监控整个子集合?

关注这个answer我尝试使用事务来监视整个Firestore子集合以添加新文档。基本上,如果只有一个文档,我只想将新文档写入子集合。我需要使用事务来避免竞争条件导致子集合中有>2个文档。最大值应为2。如何使用事务来监控添加到子集合的文档?我尝试了很长时间,但无法解决。我正在尝试使用遍历文档的子集合,但不知道如何通过事务执行此操作。到目前为止我的代码(可能是错误的方法):Firestore.instance.runTransaction((transaction)async{finalCollectionReferencecollectionRef=ref.document(‘docu

firebase - Flutter 中的 Cloud Firestore getAll() 等效项

我有几个文档ID,想在收集完所有文档ID后运行一个函数。现在我的代码是这样的:List>futures=[];currentVenuesIds.forEach((currentVenueId){FuturevenueFuture=Firestore.instance.collection('venues').document(currentVenueId).get();futures.add(venueFuture);});futures.getAll(...)//?????????Thisdoesnotexist在CloudFirestore文档中,有一个名为getAll()的方法:

firebase - Flutter 中的 Cloud Firestore getAll() 等效项

我有几个文档ID,想在收集完所有文档ID后运行一个函数。现在我的代码是这样的:List>futures=[];currentVenuesIds.forEach((currentVenueId){FuturevenueFuture=Firestore.instance.collection('venues').document(currentVenueId).get();futures.add(venueFuture);});futures.getAll(...)//?????????Thisdoesnotexist在CloudFirestore文档中,有一个名为getAll()的方法: